package router

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/net/ghttp"
	"websocket/internal/controller"
)

func bindWebsocketController(group *ghttp.RouterGroup) {
	//group.Middleware(service.Middleware().Auth)
	g.Server().BindHandler("/api/websocket/upgrade", controller.Websocket.Upgrade)
	group.Group("/websocket", func(group *ghttp.RouterGroup) {
		group.PUT("enable", controller.Websocket.SetEnable)
		group.DELETE("cancel-all", controller.Websocket.CancelAll)
		group.GET("clients", controller.Websocket.Clients)
		group.GET("broadcast-server-datetime", controller.Websocket.BroadcastServerDatetime)
	})
}
